
package gal.game.core
{
	import flash.display.Sprite;
	
	import gal.game.core.layers.BackgroundLayer;
	import gal.game.core.layers.RoleLayer;
	import gal.game.core.layers.UILayer;
	import gal.game.manager.SceneManger;
	import gal.game.manager.UIManager;
	import gal.game.module.gal.GalModel;
	
	
	/**
	 * @author 缺硒
	 */
	public class GMain extends Sprite
	{
		private var _backgroundLayer:BackgroundLayer;
		private var _roleLayer:RoleLayer;
		private var _uiLayer:UILayer
		
		// 构造函数
		public function GMain()
		{
			_backgroundLayer 	= new BackgroundLayer();
			_roleLayer			= new RoleLayer();
			_uiLayer			= new UILayer();
			
			addChild(_backgroundLayer);
			addChild(_roleLayer);
			addChild(_uiLayer);
			
			SceneManger.getInstance().bindBackground(_backgroundLayer);
			SceneManger.getInstance().bindRoleLayer(_roleLayer);
			UIManager.getInstance().bindUILayer(_uiLayer);
			
			initManager()
			initModels();
		}
		
		//初始化管理器
		private function initManager():void
		{
			SceneManger.getInstance();
		}
		
		//初始化模块
		private function initModels():void
		{
			GalModel.getInstance();
		}

		//
	}
}